
function Get-CMBootImagePackage
{
<#
.Synopsis
    Returns a Boot Image Package, or all instances of an Boot Image Package.
.Description
    Returns an Boot Image Package, or all instances of an Boot Image Package.
.Parameter SiteServerName 
    ConfigMgr Site Server Name
.Parameter PackageID
    Enter Boot Image PackageID    
.Parameter Credential 
    Enter Alternate Credentials if required
.Example
    Get-CMBootImagePackage
.Example
    Get-CMBootImagePackage MYTESTLABServer
        Returns all instances of the SMS_BootImagePackage Class on MYTESTLABServer
.Example
    Get-CMBootImagePackage MYTESTLABServer LAB00012 
        Returns package LAB20012 on MYTESTLABServer
.Example
    Get-CMBootImagePackage MYTESTLABServer LAB00012 get-credential
        Prompts for credentials
.Example
    Get-CMBootImagePackage MYTESTLABServer LAB00012 $Cred
        uses credentials in $Cred
.Outputs
    Returns either an instance, or multiple instances from the SMS_BootImagePackage Class
.Link
    http://msdn.microsoft.com/en-us/library/cc146094.aspx
.Notes
 NAME:      Get-CMBootImagePackage
 AUTHOR:    Greg Ramsey
 LASTEDIT:  08/07/2009 10:54:05
#Requires -Version 2.0
#>

[CmdletBinding(
    SupportsShouldProcess=$False,
    SupportsTransactions=$False, 
    ConfirmImpact="None",
    DefaultParameterSetName="")]
param(
[Parameter(Position=0)]
[String]$ComputerName="." ,

[Parameter(Position=1)]
[String]$PackageID ,

[Parameter(Position=2)]
[String]$Filter ,

[Parameter(Position=3)]
$Credential
)

Begin
{
}#Begin

Process
{
    get-cmobject -class SMS_BootImagePackage -ComputerName $ComputerName -Filter $Filter -Credential $Credential | ? {$_.PackageID -like ($PackageID + "*")}
}#Process

End
{
}#End
}


function Get-CMDriverPackage
{
<#
.Synopsis
    Returns a Driver Package, or all instances of an Driver Package.
.Description
    Returns an Driver Package, or all instances of an Driver Package.
.Parameter SiteServerName 
    ConfigMgr Site Server Name
.Parameter PackageID
    Enter Boot Image PackageID    
.Parameter Credential 
    Enter Alternate Credentials if required
.Example
    Get-CMDriverPackage
.Example
    Get-CMDriverPackage MYTESTLABServer
        Returns all instances of the SMS_DriverPackage Class on MYTESTLABServer
.Example
    Get-CMDriverPackage MYTESTLABServer LAB00012 
        Returns driver package LAB20012 on MYTESTLABServer
.Example
    Get-CMDriverPackage MYTESTLABServer LAB00012 get-credential
        Prompts for credentials
.Example
    Get-CMDriverPackage MYTESTLABServer LAB00012 $Cred
        uses credentials in $Cred
.Outputs
    Returns either an instance, or multiple instances from the SMS_DriverPackage Class
.Link
    http://msdn.microsoft.com/en-us/library/cc145623.aspx
.Notes
 NAME:      Get-CMDriverPackage
 AUTHOR:    Greg Ramsey
 LASTEDIT:  08/07/2009 10:54:05
#Requires -Version 2.0
#>

[CmdletBinding(
    SupportsShouldProcess=$False,
    SupportsTransactions=$False, 
    ConfirmImpact="None",
    DefaultParameterSetName="")]
param(
[Parameter(Position=0)]
[String]$ComputerName="." ,

[Parameter(Position=1)]
[String]$PackageID ,

[Parameter(Position=2)]
[String]$Filter ,

[Parameter(Position=3)]
$Credential
)

Begin
{
}#Begin

Process
{
    get-cmobject -class SMS_DriverPackage -ComputerName $ComputerName -Filter $Filter -Credential $Credential | ? {$_.PackageID -like ($PackageID + "*")}
}#Process

End
{
}#End
}



function Get-CMImagePackage
{
<#
.Synopsis
    Returns a Image Package, or all instances of a Image (.wim) Package.
.Description
    Returns an Image Package, or all instances of a Image (.wim) Package.
.Parameter SiteServerName 
    ConfigMgr Site Server Name
.Parameter PackageID
    Enter Driver PackageID    
.Parameter Credential 
    Enter Alternate Credentials if required
.Example
    Get-CMImagePackage
        Returns all instances of the SMS_ImagePackage Class on the local site server
.Example
    Get-CMImagePackage MYTESTLABServer
        Returns all instances of the SMS_ImagePackage Class on MYTESTLABServer
.Example
    Get-CMImagePackage MYTESTLABServer LAB00012 
        Returns Image Package LAB20012 on MYTESTLABServer
.Example
    Get-CMImagePackage MYTESTLABServer LAB00012 get-credential
        Prompts for credentials
.Example
    Get-CMImagePackage MYTESTLABServer LAB00012 $Cred
        uses credentials in $Cred
.Outputs
    Returns either an instance, or multiple instances from the SMS_ImagePackage Class
.Link
    http://msdn.microsoft.com/en-us/library/cc144889.aspx
.Notes
 NAME:      Get-CMImagePackage
 AUTHOR:    Greg Ramsey
 LASTEDIT:  08/07/2009 10:54:05
#Requires -Version 2.0
#>

[CmdletBinding(
    SupportsShouldProcess=$False,
    SupportsTransactions=$False, 
    ConfirmImpact="None",
    DefaultParameterSetName="")]
param(
[Parameter(Position=0)]
[String]$ComputerName="." ,

[Parameter(Position=1)]
[String]$PackageID ,

[Parameter(Position=2)]
[String]$Filter ,

[Parameter(Position=3)]
$Credential
)

Begin
{
}#Begin

Process
{
    get-cmobject -class SMS_ImagePackage -ComputerName $ComputerName -Filter $Filter -Credential $Credential | ? {$_.PackageID -like ($PackageID + "*")}    
}#Process

End
{
}#End
}


function Get-CMOSInstallPackage
{
<#
.Synopsis
    Returns a Operating System Install Package, or all instances of an Operating System Install Package.
.Description
    Returns an Operating System Install Package, or all instances of an Operating System Install Package.
.Parameter SiteServerName 
    ConfigMgr Site Server Name
.Parameter PackageID
    Enter PackageID    
.Parameter Credential 
    Enter Alternate Credentials if required
.Example
    Get-CMOSInstallPackage
.Example
    Get-CMOSInstallPackage MYTESTLABServer
        Returns all instances of the SMS_OperatingSystemInstallPackage Class on MYTESTLABServer
.Example
    Get-CMOSInstallPackage MYTESTLABServer LAB00012 
        Returns Operating System Install Package LAB20012 on MYTESTLABServer
.Example
    Get-CMOSInstallPackage MYTESTLABServer LAB00012 get-credential
        Prompts for credentials
.Example
    Get-CMOSInstallPackage MYTESTLABServer LAB00012 $Cred
        uses credentials in $Cred
.Outputs
    Returns either an instance, or multiple instances from the SMS_OperatingSystemInstallPackage Class
.Link
    http://msdn.microsoft.com/en-us/library/cc143107.aspx
.Notes
 NAME:      Get-CMOSInstallPackage
 AUTHOR:    Greg Ramsey
 LASTEDIT:  08/07/2009 10:54:05
#Requires -Version 2.0
#>

[CmdletBinding(
    SupportsShouldProcess=$False,
    SupportsTransactions=$False, 
    ConfirmImpact="None",
    DefaultParameterSetName="")]
param(
[Parameter(Position=0)]
[String]$ComputerName="." ,

[Parameter(Position=1)]
[String]$PackageID ,

[Parameter(Position=2)]
[String]$Filter ,

[Parameter(Position=3)]
$Credential
)

Begin
{
}#Begin

Process
{
    get-cmobject -class SMS_OperatingSystemInstallPackage -ComputerName $ComputerName -Filter $Filter -Credential $Credential | ? {$_.PackageID -like ($PackageID + "*")}
}#Process

End
{
}#End
}


function Get-CMTSPackage
{
<#
.Synopsis
    Returns a task sequence package, or all instances of a task sequence package.
.Description
    Returns a task sequence package, or all instances of a task sequence package.
.Parameter SiteServerName 
    ConfigMgr Site Server Name
.Parameter PackageID
    Enter PackageID    
.Parameter Credential 
    Enter Alternate Credentials if required
.Example
    Get-CMTSPackage
.Example
    Get-CMTSPackage MYTESTLABServer
        Returns all instances of the SMS_TaskSequencePackage Class on MYTESTLABServer
.Example
    Get-CMTSPackage MYTESTLABServer LAB00012 
        Returns package LAB00012 on MYTESTLABServer
.Example
    Get-CMTSPackage MYTESTLABServer LAB00012 get-credential
        Prompts for credentials
.Example
    Get-CMTSPackage MYTESTLABServer LAB00012 $Cred
        uses credentials in $Cred
.Outputs
    Returns either an instance, or multiple instances from the SMS_TaskSequencePackage Class
.Link
    http://msdn.microsoft.com/en-us/library/cc144760.aspx
.Notes
 NAME:      Get-CMTSPackage
 AUTHOR:    Greg Ramsey
 LASTEDIT:  08/07/2009 00:39:05
#Requires -Version 2.0
#>

[CmdletBinding(
    SupportsShouldProcess=$False,
    SupportsTransactions=$False, 
    ConfirmImpact="None",
    DefaultParameterSetName="")]
param(
[Parameter(Position=0)]
$ComputerName="." ,

[Parameter(Position=1)]
[String]$PackageID ,

[Parameter(Position=2)]
[String]$Filter ,

[Parameter(Position=3)]
$Credential
)

Begin
{
}#Begin

Process
{
    if ($PackageID -eq "")
    {
        get-cmobject -class SMS_TaskSequencePackage -ComputerName $ComputerName -Filter $Filter -Credential $Credential | ? {$_.PackageID -like ($PackageID + "*")}
    }
    else
    {
        get-cmobject -class SMS_TaskSequencePackage -ComputerName $ComputerName -Filter $Filter -Credential $Credential
    }
    
}#Process

End
{
}#End
}

